window.addEvent('load',function()
{
    //斑马表
    var list=new ZebraTable(document.getElementById('List'));
    {
        list.Color_1='#ffffff';
        list.Color_2='#f6f6f6';
        list.Color_3='#ebeff9';
        list.Render('tbody');
    }
    list=null;

    
    //添加
     $$('#LinkAdd').addEvent('click',function()
    {
	  var a=$$('input[name="IsList_Add"]');
	  if(a[0].checked)
        {
		if($('URL_Add').value=="")
		{  
           	  malert('链接地址不能为空');
			  return false;
		}
	  }
	  if($('ClassID').value=='')
        {
			malert('模块不能为空');	
			return false;  
        }
        if($('Name_Add').value=='')
        {
			malert('功能名称不能为空');	  
			return false;
        }
	  else if($('Role_Add').value=='')
        {
			malert('权限值不能为空');	  
			return false;
        }
	  else
	  {
		$('Form1').action='function.permission.add.action.php';
            $('Form1').submit();  
	  }
    });
    
});

function Edit(ID,Page,Select_Class)
{
	var IsLists;
	var a=$$('input[name="IsList_'+ID+'"]');
	a[0].checked ? IsLists=1 : IsLists=0;
	var ClassID=$('ClassID_'+ID).value;
	var Names=$('Name_'+ID).value;
	var Roles=$('Role_'+ID).value;
	var URLs=$('URL_'+ID).value;
	window.location='function.permission.edit.action.php?id='+ID+'&name='+Names+'&role='+Roles+'&url='+URLs+'&classid='+ClassID+'&islist='+IsLists+'&Page='+Page+'&select_class='+Select_Class;       
}